/**
 * 
 */
package fr.cephb.operonj.core.db.comparator;

import java.util.Comparator;

import com.sleepycat.bind.tuple.TupleInput;

import fr.cephb.operonj.core.db.binding.SequenceIndexBinding;
import fr.cephb.operonj.core.db.key.SequenceIndex;

/**
 * @author pierre
 *
 */
public class SequenceIndexComparator
	implements Comparator<byte[]>
	{
	@Override
	public int compare(byte[] o1, byte[] o2)
		{
		SequenceIndexBinding binding= new SequenceIndexBinding();
		SequenceIndex t1= binding.entryToObject(new TupleInput(o1));
		SequenceIndex t2= binding.entryToObject(new TupleInput(o2));
		return t1.compareTo(t2);
		}
	}
